from hdfs.client import Client

client = Client("http://master:9870/")

def callback(filename, size):
    print(filename, "完成一个chunk上传", "当前大小", size)
    if size == -1:
        print("文件上传成功")

client.upload(local_path="./reptile_news.sh", hdfs_path="/user/caixinpeng", progress=callback, cleanup=True)
